package main

import (
	"fmt"
	r "linproxy/acl/rule"
)

func main() {

	// exactip := "192.168.10.1"
	// cidrip := "192.168.1.5/24"
	// rangeip := "192.168.1.1-192.168.2.2"
	iplist := []string{"192.168.10.1", "192.168.2.1/24", "192.168.1.1-192.168.2.2"}
	for _, ip := range iplist {
		if check := r.IsExactIp(ip); check {
			fmt.Println("是合法的单IP:", ip)
			continue
		} else if check := r.IsCIDRIp(ip); check {
			fmt.Println("是合法的CIDR:", ip)
			continue
		} else if check := r.IsRangeIp(ip); check {
			fmt.Println("是合法的范围IP:", ip)
			continue
		}
	}

}
